@CONTAINER_WITH_BORDER_OFFSET: 7px;

@BORDER_PADDING: 1px;
@CONTAINER_PADDING: @BORDER_PADDING @BORDER_PADDING @BORDER_PADDING @CONTAINER_WITH_BORDER_OFFSET;

@NODE_OFFSET: 26px;

@ITEM_WITH_CHECKBOX_OFFSET: 35px;

@CHECKBOX_OFFSET: 30px;

@SELECT_ALL_ITEM_OFFSET: 30px;
@SELECT_ALL_TEXT_OFFSET: 31px;
@SELECT_ALL_ITEM_LEFT_PADDING: @SELECT_ALL_ITEM_OFFSET + @CONTAINER_WITH_BORDER_OFFSET;

@ANDRIOD_TREEVIEW_LOADINCICATOR_OFFSET_TOP: 11px;
@ANDRIOD_TREEVIEW_LOADINCICATOR_OFFSET_LEFT: 3px;
@ANDRIOD_TREEVIEW_LOADINCICATOR_SIZE: 20px;
@ANDROID5_TREEVIEW_EXPANDER_COLOR: #757575;

@ANDROID5_TREEVIEW_ARROW_ICON_SIZE: 14px;

.dx-treeview-node-loadindicator {
    width: @ANDRIOD_TREEVIEW_LOADINCICATOR_SIZE;
    height: @ANDRIOD_TREEVIEW_LOADINCICATOR_SIZE;
    top: @ANDRIOD_TREEVIEW_LOADINCICATOR_OFFSET_TOP;
    left: @ANDRIOD_TREEVIEW_LOADINCICATOR_OFFSET_LEFT;

    > .dx-loadindicator-wrapper {
        font-size: @ANDRIOD_TREEVIEW_LOADINCICATOR_SIZE;
    }
}

.dx-treeview {
    &.dx-treeview-border-visible {
        border: 1px solid @ANDROID5_TREE_VIEW_BORDER_COLOR;

        .dx-treeview-select-all-item {
            padding-left: @SELECT_ALL_ITEM_LEFT_PADDING;
        }

        .dx-scrollable-content {
            >.dx-treeview-node-container {
                padding: @CONTAINER_PADDING;
            }
        }
    }

    .dx-treeview-select-all-item {
        margin: 0 0 7px 0;
        border-bottom: 1px solid @ANDROID5_TREE_VIEW_BORDER_COLOR;
        padding: 15px 0 15px @SELECT_ALL_ITEM_OFFSET;

        .dx-checkbox-text {
            padding-left: @SELECT_ALL_TEXT_OFFSET;
        }
    }

    .dx-treeview-node {
        padding-left: @NODE_OFFSET;

        &.dx-treeview-item-with-checkbox {
            .dx-treeview-item {
                padding-left: @ITEM_WITH_CHECKBOX_OFFSET;
            }
        }

        &:not(.dx-treeview-item-with-checkbox) {
            &.dx-state-selected {
                > .dx-treeview-item {
                    background-color: @ANDROID5_SELECTED_STATE_BACKGROUND_COLOR;
                }
            }
        }

        .dx-checkbox {
            top: 12px;
            left: @CHECKBOX_OFFSET;
        }
    }

    .dx-treeview-item {
        padding: 8px 6px 6px 3px;
        min-height: 42px;

        .dx-treeview-item-content {
            color: @ANDROID5_TREE_VIEW_TEXT_COLOR;
        }

        .dx-icons-dark();

        .dx-icon {
            .dx-icon-sizing(@ANDROID_BASE_ICON_SIZE);
        }

        &.dx-state-hover {
            background-color: @ANDROID5_TREE_VIEW_HOVERED_STATE_BACKGROUND;
        }
    }

    .dx-state-focused > .dx-treeview-item {
        background-color: @ANDROID5_TREE_VIEW_FOCUSED_BACKGROUND;
    }

    .dx-treeview-toggle-item-visibility {
        .dx-icon-chevronright;
        color: @ANDROID5_TREEVIEW_EXPANDER_COLOR;
        .dx-icon-font-centered-sizing(@ANDROID5_TREEVIEW_ARROW_ICON_SIZE);
        width: 21px;
        height: 42px;
        top: 0;
        left: 0;

        &:before {
            font-weight: bold;
        }

        &.dx-treeview-toggle-item-visibility-opened {
            .dx-icon-chevrondown;
        }
    }

    &.dx-rtl {
        .dx-treeview > .make-rtl(@CONTAINER_WITH_BORDER_OFFSET, @NODE_OFFSET, @ITEM_WITH_CHECKBOX_OFFSET, @CHECKBOX_OFFSET, @SELECT_ALL_TEXT_OFFSET, @SELECT_ALL_ITEM_LEFT_PADDING, @BORDER_PADDING);
    }
}
